# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python-cloudscraper
_pkgname=cloudscraper
pkgver=1.2.71
pkgrel=4
pkgdesc="A Python module to bypass Cloudflare's anti-bot page."
arch=('any')
url='https://pypi.org/project/cloudscraper/'
license=('MIT')
depends=('python-pyparsing' 'python-requests' 'python-requests-toolbelt')
optdepends=('python-js2py: alternative interpreter/solver'
            'nodejs: alternative interpreter/solver')
makedepends=('python-build' 'python-installer' 'python-setuptools'
             'python-wheel')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('e87f068371a4f9179267a5f0871ecfa5a425772d78bf02c2f8ad2800efe43f6bc75abf129dbf78a7cc8c41989c9651d8d84c3d27851e32541b15d729891b70dc')

build(){
  cd "$_pkgname-$pkgver"

  python -m build --wheel --no-isolation
}

package() {
  cd "$_pkgname-$pkgver"

  python -m installer --destdir="$pkgdir" dist/*.whl

  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

